package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.concurrent.TimeUnit;

@Service
public class HelloServiceImpl implements HelloService {

    @Override
    public String sayHello(String name, int timeToWait) {
/*        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        return "hello:"+name;
    }

    @Override
    public String methodA() {

        try {
            Thread.sleep((int) (Math.random() * 100));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "methodA";
    }

    @Override
    public String methodB() {
        try {
            Thread.sleep((int) (Math.random() * 100));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "methodB";
    }

    @Override
    public String methodC() {
        try {
            Thread.sleep((int) (Math.random() * 100));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "methodC";
    }
}
